﻿<UserControl x:Class="CncConvProg.View.Lavorazioni.Foratura.Pattern.DrillingPatternSelectionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:ValueConverter="clr-namespace:CncConvProg.View.ValueConverter" 
             xmlns:Foratura="clr-namespace:CncConvProg.Model.ConversationalStructure.Lavorazioni.Foratura;assembly=CncConvProg.Model" mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="600">
    <UserControl.Resources>
        <ValueConverter:EnumToBoolConverter x:Key="EBConverter"/>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height=".5*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <GroupBox Header="Pattern Selected" Grid.ColumnSpan="2">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width=".5*" />
                </Grid.ColumnDefinitions>
                <ListBox x:Name="RadioButtonList" BorderThickness="0" Background="{x:Null}">
                    <ListBox.ItemContainerStyle>
                        <Style TargetType="{x:Type ListBoxItem}">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                        <ContentPresenter/>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </ListBox.ItemContainerStyle>
                    <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton1, Mode=OneWay}">
                        <RadioButton IsChecked="{Binding Path=PatternForatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Foratura:PatternForatura.Circolare}}" Content="Circle"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton1"     
                        />
                    </ListBoxItem>
                    <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton3, Mode=OneWay}">
                        <RadioButton IsChecked="{Binding Path=PatternForatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Foratura:PatternForatura.Rettangolare}}" Content="Rectangular"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton3" 
                    />
                    </ListBoxItem>
                    <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton4, Mode=OneWay}">
                        <RadioButton IsChecked="{Binding Path=PatternForatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Foratura:PatternForatura.Arco}}" Content="Arc"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton4" 
                    />
                    </ListBoxItem>
                    <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton5, Mode=OneWay}">
                        <RadioButton IsChecked="{Binding Path=PatternForatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Foratura:PatternForatura.Linea}}" Content="Line"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton5" 
                    />
                    </ListBoxItem>
                    <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton6, Mode=OneWay}">
                        <RadioButton IsChecked="{Binding Path=PatternForatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Foratura:PatternForatura.CoordinateXy}}" Content="Coordinate XY"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton6" 
                    />
                    </ListBoxItem>
                    <ListBoxItem IsSelected="{Binding IsChecked, ElementName=RadioButton2, Mode=OneWay}">
                        <RadioButton IsChecked="{Binding Path=PatternForatura,   
                        Converter={StaticResource EBConverter},   
                        ConverterParameter={x:Static Member=Foratura:PatternForatura.CoordinateRc}}" Content="Coordinate Radius Angle"
                        GroupName="Sgrossatura"
                        x:Name="RadioButton2" 
                    />
                    </ListBoxItem>

                </ListBox>
                <Image Margin="10" Grid.Column="1" Width="150" Height="150" Source="{Binding SelectedItem.Tag, ElementName=RadioButtonList}" VerticalAlignment="Top" HorizontalAlignment="Left" />
            </Grid>
        </GroupBox>
        <GroupBox Header="Pattern Parameter" Grid.Row="1" Grid.ColumnSpan="2">
            <ContentControl Content="{Binding Path=PatternParameter}"/>
        </GroupBox>
    </Grid>
</UserControl>
